package com.riaevolution.components.ModuleFactory
{
	import mx.modules.IModuleInfo;
	
	public class ModuleItem implements IModuleItem
	{
		public var moduleReady:Boolean = false;
		public var autocreate:Boolean;
		public var label:String;
		public var name:String;
		public var uri:String;
		public var module:IModuleInfo;
		public var index:int;
		public var width:int;
		public var height:int;
		public var component:*;
		
		public function getWidth():Number {
			return this.width;
		}
		public function getHeight():Number {
			return this.height;
		}
		public function getName():String {
			return this.name;
		}
		public function isReady():Boolean {
			return this.moduleReady;
		}
		public function getComponent(rest:Array):Object {
			if(!moduleReady) return null;
			return module.factory.create(rest);
			//return component;
		}
		public function toString():String {
			return "{" + 
					"label:"+this.label+",\n" + 
					"Name:"+this.name+",\n" +
					"uri:"+this.uri+",\n" +
					"width:"+this.width+",\n" +
					"height:"+this.height+",\n" +
					"module:"+this.module.data+",\n"+
					"error:"+this.module.error+"}";
		}
	}
}